//
//  ZLiCloudFileManager.swift
//  AudioToolProject
//
//  Created by 邹琳 on 2019/5/9.
//  Copyright © 2019 邹琳. All rights reserved.
//

import UIKit

class ZLiCloudFileManager: UIDocument {
    var data:Data?
    override func load(fromContents contents: Any, ofType typeName: String?) throws {
        self.data = contents as? Data
    }
	
    static func downloadFile(url:URL,finish:@escaping(Data?)->Void){
        let doc = ZLiCloudFileManager(fileURL: url)
        doc.open { (success) in
            if success{
                let tempData = doc.data
//                let
                doc.close(completionHandler: { (closeSuccess) in
                	
                })
                finish(tempData)
            }
        }
    }
}
